using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class documentMap : EntityTypeConfiguration<document>
    {
        public documentMap()
        {
            // Primary Key
            this.HasKey(t => t.docu_id);

            // Properties
            this.Property(t => t.docu_id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.docu_type)
                .HasMaxLength(20);

            this.Property(t => t.docu_name)
                .HasMaxLength(60);

            this.Property(t => t.docu_route)
                .HasMaxLength(64);

            this.Property(t => t.create_by)
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("document");
            this.Property(t => t.docu_id).HasColumnName("docu_id");
            this.Property(t => t.docu_type).HasColumnName("docu_type");
            this.Property(t => t.docu_name).HasColumnName("docu_name");
            this.Property(t => t.docu_size).HasColumnName("docu_size");
            this.Property(t => t.docu_route).HasColumnName("docu_route");
            this.Property(t => t.disable_flag).HasColumnName("disable_flag");
            this.Property(t => t.download_count).HasColumnName("download_count");
            this.Property(t => t.publish_flag).HasColumnName("publish_flag");
            this.Property(t => t.create_time).HasColumnName("create_time");
            this.Property(t => t.create_by).HasColumnName("create_by");
        }
    }
}
